<template>
  <GoodsTable  :dataObject="products"></GoodsTable>
</template>

<script>
import { getallproducts } from "../../api/data";
import GoodsTable from "../../components/GoodsTable.vue";

export default {
  components: {
    GoodsTable,
  },
  data() {
    return {
      products: [],
    };
  },
  methods: {
    getlist() {
      getallproducts().then((res) => {
        if (res.status === 200) {
          this.products = res.data;
        }
      });
    },
  },
  created() {
    this.$nextTick(() => {
      this.getlist();
    });
  },
};
</script>

<style>
</style>